<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1">
    <title>基本信息</title>
    <link rel="stylesheet" href="../../front/css/common.css">
    <link rel="stylesheet" href="../../front/weui/css/weui.min.css">
    <link rel="stylesheet" href="../../front/weui/css/jquery-weui.css">
    <link rel="stylesheet" href="../../front/weui/css/demos.css">
    <script type="text/javascript" src="../../front/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../front/js/common.js"></script>
</head>
<body>
<div id="registered">
    <div class="ly_header header2">基本信息<div class="ly_left goback"><img src="../../front/image/gobackbai.png" alt=""></div></div>
    <div>
        <form id="baseinfo" th:action="@{/common/toUpload.action}" method="post">
            <div class="registered_box">
                <div class="information registered_head">
                    <img src="../../front/image/leftlogo.png" alt="">个人信息
                </div>
                <div class="information dw">
                    <div class="informationname">真实姓名：</div>
                    <input class="informationinput" name="realName" type="text" th:value="${memberAuthenticationInfoVO.realName}">
                </div>
                <div class="information dw">
                    <div class="informationname">性别：</div>
                    <div class="informationinput color9 selectgender" th:switch="${memberAuthenticationInfoVO.memberSex}">
                        <span th:case="MALE">男</span>
                        <span th:case="FEMALE">女</span>
                    </div>
                    <input name="memberSex" readonly th:value="${memberAuthenticationInfoVO.memberSex}" type="hidden">
                </div>
                <div class="information dw">
                    <div class="informationname">手机号</div>
                    <input class="informationinput" name="phone" th:value="${memberAuthenticationInfoVO.phone}" type="text">
                </div>
                <div class="information dw">
                    <div class="informationname">邮箱：</div>
                    <input class="informationinput color9" name="memberEmail" th:value="${memberAuthenticationInfoVO.memberEmail}" type="text">
                </div>
            </div>
            <div class="registered_box">
                <div class="information registered_head">
                    <img src="../../front/image/leftlogo.png" alt="">身份证
                </div>
                <div class="information dw">
                    <div class="informationname">身份证：</div>
                    <input class="informationinput" name="idNumber" th:value="${memberAuthenticationInfoVO.idNumber}" type="text">
                </div>
                <div class="information dw">
                    <div class="informationname">身份证电子版</div>
                    <input class="informationinput" name="idCardBackUrl" th:value="${memberAuthenticationInfoVO.idCardBackUrl}" type="hidden">
                    <input class="informationinput" name="idCardFrontUrl" th:value="${memberAuthenticationInfoVO.idCardFrontUrl}" type="hidden">
                    <a href="javaScript:;" class="dw triangle showhide" boxshow="#idcard" boxhide="#registered">上传</a>
                </div>
            </div>
            <div class="registered_box">
                <div class="information registered_head">
                    <img src="../../front/image/leftlogo.png" alt="">转业状态
                </div>
                <div class="information dw">
                    <div class="informationname">转业状态</div>
                    <div class="informationinput professionalselect" th:switch="${memberAuthenticationInfoVO.arrangeForType}">
                        <span th:case="DIMISSION">安置后离职</span>
                        <span th:case="SELF_EMPLOYMENT">自主</span>
                    </div>
                    <input name="arrangeForType" readonly th:value="${memberAuthenticationInfoVO.arrangeForType}" type="hidden">
                </div>
            </div>
            <div class="registered_box hide" id="independent">
                <div class="information registered_head">
                    <img src="../../front/image/leftlogo.png" alt="">自主择业正<span class="color6">(选填)</span>
                </div>
                <div class="information dw">
                    <div class="informationname">自主择业证号：</div>
                    <input class="informationinput" name="selfEmploymentCode" th:value="${memberAuthenticationInfoVO.selfEmploymentCode}" type="text">
                </div>
                <div class="information dw">
                    <div class="informationname">自主择业证电子版</div>
                    <input class="informationinput" name="chooseJobCertificateUrl" th:value="${memberAuthenticationInfoVO.chooseJobCertificateUrl}" readonly type="hidden">
                    <a href="javaScript:;" class="dw triangle showhide" boxshow="#professional" boxhide="#registered">上传</a>
                </div>
            </div>
            <div class="registered_box">
                <div class="information registered_head">
                    <img src="../../front/image/leftlogo.png" alt="">常住地<span class="color6">(选填)</span>
                </div>
                <div class="information dw">
                    <div class="informationname">常住地（省-市-区）</div>
                    <input class="informationinput" name="reside" id="start" readonly th:value="${memberAuthenticationInfoVO.reside}" type="text">
                </div>
            </div>
            <div class="registered_box">
                <div>
                    <input type="hidden" name="infoType" value="BASE_INFO">
                    <button type="button" class="submit_registered">提交</button>
                </div>
            </div>
        </form>
        <div id="mask" class="hide"></div>
        <div class="hide gender drop-down">
            <div class="ly_header">转业状态
                <div class="ly_left genderno"><img src="../../front/image/no.png" alt=""></div>
                <div class="ly_right genderyes"><img src="../../front/image/yes.png" alt=""></div></div>
            <div class="insteadOf"></div>
            <ul class="selectlist genderlist" style="">
                <li dataval="MALE">男</li>
                <li dataval="FEMALE">女</li>
            </ul>
        </div>
        <div class="hide professional drop-down">
            <div class="ly_header">转业状态
                <div class="ly_left professionalno"><img src="../../front/image/no.png" alt=""></div>
                <div class="ly_right professionalyes"><img src="../../front/image/yes.png" alt=""></div></div>
            <div class="insteadOf"></div>
            <ul class="professionallist selectlist" style="">
                <li dataval="DIMISSION">安置后离职</li>
                <li dataval="SELF_EMPLOYMENT">自主</li>
            </ul>
        </div>
    </div>
</div>
<div id="idcard" class="hide">
    <div class="ly_header header2">身份证
        <div class="ly_left showhide" boxshow="#registered" boxhide="#ridcard"><img src="../../front/image/gobackbai.png" alt=""></div>
        <div class="ly_right showhide" boxshow="#registered" boxhide="#ridcard" style="font-size: 0.8em;">保存</div>
    </div>
    <div class="ly_indexmain mart20 marginheard">
        <div class="idcardplus">
            <div style="">身份证正面照</div>
            <div class="dw">
                <img  src="../../front/image/idcard_1.png" style="height:91px" alt="">
                <input type="file" name="idcardplus" imgaddress="idCardBackUrl" class="dw_r uploadimg">
            </div>
            <div style="">只支持png/jpg格式</div>
        </div>
        <div class="idcardminus">
            <div style="font-size: 0.9em;line-height: 2;">身份证背面照</div>
            <div class="dw">
                <img src="../../front/image/idcard_2.png" style="height:91px" alt="">
                <input type="file" name="idcardminus" imgaddress="idCardFrontUrl" class="dw_r uploadimg">
            </div>
            <div style="font-size: 0.8em;line-height: 2;">只支持png/jpg格式</div>
        </div>
        <div class="idcardtitle mart20">
            <img class="imgmindw" src="../../front/image/idcardzhu.png" alt="">注意事项
        </div>
        <div class="mart20">
            <div class="left box4 text_center">
                <img src="../../front/image/idcardicon_1.png" alt="">
                <div class="idcardyon">
                    <img  class="imgmindw" src="../../front/image/idcardyes.png" alt="">标准
                </div>

            </div>
            <div class="left box4 text_center">
                <img src="../../front/image/idcardicon_2.png" alt="">
                <div class="idcardyon">
                    <img  class="imgmindw" src="../../front/image/idcardno.png" alt="">边框确实
                </div>
            </div>
            <div class="left box4 text_center">
                <img src="../../front/image/idcardicon_3.png" alt="">
                <div class="idcardyon">
                    <img  class="imgmindw" src="../../front/image/idcardno.png" alt="">闪光强烈
                </div>
            </div>
            <div class="left box4 text_center">
                <img src="../../front/image/idcardicon_4.png" alt="">
                <div class="idcardyon">
                    <img class="imgmindw" src="../../front/image/idcardno.png" alt="">照片模糊
                </div>
            </div>
            <div style="clear: both"></div>
        </div>
    </div>
</div>
<div id="professional" class="hide">
    <div class="ly_header header2" style="z-index: 6;position: fixed;display: block;width: 100%;top: 0;">自主择业证
        <div class="ly_left showhide" boxshow="#registered" boxhide="#professional"><img src="../../front/image/gobackbai.png" alt=""></div>
        <div class="ly_right showhide" boxshow="#registered" boxhide="#professional" style="font-size: 0.8em;">保存</div>
    </div>
    <div class="choosework">
        <div style="width: 326px;height: 476px;background: white;margin: 50px auto;text-align: center;padding-top: 100px">
            <div style="font-size: 0.9em;line-height: 2;"><img class="imgmindw" src="../../front/image/professionalicon.png" alt="">自主择业证</div>
            <div class="dw">
                <img src="../../front/image/professionalbtn.png" alt="">
                <input type="file" name="professional" imgaddress="chooseJobCertificateUrl" style="width:175px" class="dw_r uploadimg">
            </div>
            <div style="font-size: 0.8em;line-height: 2;color: #999">只支持png/jpg格式</div>
        </div>
    </div>
</div>
<script type="text/javascript" src="../../front/js/information.js"></script>
<script type="text/javascript" src="../../front/weui/js/fastclick.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
    });
</script>
<script type="text/javascript" src="../../front/weui/js/jquery-weui.js"></script>
<script type="text/javascript" src="../../front/weui/js/city-picker.js"></script>
<script>
    /*<![CDATA[*/
    ctxPath = /*[[@{/}]]*/ '';
    /*]]>*/
    $("#start").cityPicker({
        title: "常住地",
        onChange: function (picker, values, displayValues) {
            console.log(values, displayValues);
        }
    });
    $(document).on("change",".uploadimg",function(){
        var that=$(this)
        var formdata=new FormData();
        var val=$(this)[0].files[0];
        formdata.append("file",val)
        $.ajax({
             type: "post",
             url: ctxPath+"../../common/uploadMemberImage.action",
             data: formdata,
             dataType: "json",
             processData : false,
             contentType : false,
             cache: false,
             success: function(data){
             console.log(data);
                $(that).siblings("img").attr("src","../../"+data.result.url);
                $("input[name="+$(that).attr('imgaddress')+"]").val(data.result.url)
             }
         });
    })
    var regemail=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    var regphon=/^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/;
    $(document).on("click",".submit_registered",function(){
        var data={};
        var flag=0;
        $("#baseinfo input").each(function(){
            if($(this).val().trim()==""){
                flag=1;
            }
            if($(this).attr("name")=="check"){
                if($(this).attr('checked')){
                    flag=1;
                }
            }else{
                data[$(this).attr("name")]=$(this).val()
            }


        })
        if(flag==1){
            alert("请完善所有信息");
        }
        $.ajax({
            url: "/tiance/front/memberCenter/applyMemberAuth.action",
            type: "post",
            data: data, //发送数据,
            dataType: "json",
            async: false,
             success: function(data){
                console.log(data);
             },
             error:function(){
                alert()
             }
         });
    })

</script>
</body>
</html>